package team.se.tms;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.stereotype.Controller;

/**
 * 启动类
 *
 * @author winkyle
 * @date 2018/11/1.
 */
@Controller
@SpringBootApplication
//@EnableTransactionManagement
public class Application extends SpringBootServletInitializer {


    /**
     * 需要类似于web.xml的配置方式来启动spring上下文时重写此方法
     * return builder.sources(Application.class);
     * 注意这里要指向原先用main方法执行的Application启动类
     *
     * @param builder builder
     * @return SpringApplicationBuilder
     * @create on 2018/11/1 by winkyle
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder;
    }

    /**
     * 启动入口
     *
     * @param args 一些参数
     * @create on 2018/11/1 by winkyle
     */
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
